import prompt from '@system.prompt';
import router from '@system.router';
export default {
    data: {
        title: "",
        username:"张三",
        array1:[{id:"1",ima:"/common/personal/health.png",mytitle:"健康信息"},
                {id:"2",ima:"/common/personal/clean.png",mytitle:"清理缓存",},
                {id:"3",ima:"/common/personal/update.png",mytitle:"版本升级"},
        ],
        rarrows:"/common/personal/ge.png",
        "array2": [{ima:"/common/personal/help.png",mytitle:"帮助中心"},
            {ima:"/common/personal/feedback.png",mytitle:"意见反馈"},
            {ima:"/common/personal/us.png",mytitle:"关于我们"},
        ],
        menuData: [
            {
                imgSrc: "common/images_bottom_menu_bar/home.png",
                imgSrcActive: "common/images_bottom_menu_bar/home_active.png",
                title: "首页",
            },
            {
                imgSrc: "common/images_bottom_menu_bar/scenarios.png",
                imgSrcActive:
                "common/images_bottom_menu_bar/scenarios_active.png",
                title: "场景",
            },
            {
                imgSrc: "common/images_bottom_menu_bar/message.png",
                imgSrcActive:
                "common/images_bottom_menu_bar/message_active.png",
                title: "消息",
            },
            {
                imgSrc: "common/images_bottom_menu_bar/mine.png",
                imgSrcActive: "common/images_bottom_menu_bar/mine_active.png",
                title: "我的",
            },
        ],
        defaultIndex:3,

    },

    pim(){
        router.push({
            uri:"pages/person_pim/person_pim"
        })
    },

    onclick(e){
        var $id=e.target.dataSet.id;
        console.log($id);
        if ("1"==$id) {
            router.push({
                uri:"pages/per_health/per_health",
            })
        };
        if ("2"==$id) {
            prompt.showToast({
                message:"无需清理"
            })
        };
        if ("3"==$id) {
            prompt.showToast({
                message:"已经是最新版本"
            })
        };
    },

    bottomNavigationBarClick(num){
        this.defaultIndex = num
        if (0 == this.defaultIndex) {
            router.replace({
                uri: "pages/home/home",
            });
        }

        if (1 == this.defaultIndex) {
            router.replace({
                uri: "pages/scene/p1",
            });
        }

        if (2 == this.defaultIndex) {
            router.replace({
                uri: "pages/message/message",
            });
        }

        if (3 == this.defaultIndex) {
            router.replace({
                uri: "pages/personal/personal",
            });
        }
    }
}
